package com.imprenta.helpers;

import java.io.IOException;

import javax.faces.context.ExternalContext;
import javax.faces.context.FacesContext;

public class UtilHelper {
	
	static ExternalContext exContext;
	static FacesContext context;
	
	public static void redirectUrl(String url){
		context = FacesContext.getCurrentInstance();
		exContext = context.getExternalContext();
		String direccion = exContext.encodeActionURL(context.getApplication().getViewHandler().getActionURL(context, url));
		try {
			exContext.redirect(direccion);
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

}
